Skip to content

Route outline navigation to the source editor's group across windows#316828

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-outline-navigation-issue
Draft

Route outline navigation to the source editor's group across windows#316828
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-outline-navigation-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

When the Outline view (hosted in the main window) tracks an editor in an auxiliary window, clicking a symbol sometimes activates the main window instead of navigating within the auxiliary window's editor.

DocumentSymbolsOutline.reveal calls ICodeEditorService.openCodeEditor(input, source, sideBySide), where source is the auxiliary window's editor. The workbench implementation then opens via editorService.openEditor(input, ACTIVE_GROUP). Focusing/clicking the outline can shift the most-recently-active group to a main-window group, so ACTIVE_GROUP no longer points at the source's group and navigation lands in the wrong window.

Changes

  • CodeEditorService.doOpenCodeEditor: when source is provided and sideBySide is false, resolve the visible pane whose code editor equals source and target its group explicitly; fall back to ACTIVE_GROUP only if the source is no longer visible.
  • Reused the same visibleEditorPanes lookup that already drove the preview-pinning logic, so the resolved group is shared between the pin step and the open step.
let sourceGroup: IEditorGroup | undefined;
if (source && !sideBySide) {
    for (const visiblePane of this.editorService.visibleEditorPanes) {
        if (getCodeEditor(visiblePane.getControl()) === source) {
            sourceGroup = visiblePane.group;
            break;
        }
    }
}
// ...
const control = await this.editorService.openEditor(
    input,
    sideBySide ? SIDE_GROUP : (sourceGroup ?? ACTIVE_GROUP)
);

Behavior is unchanged when the source's group already is the active group, when source is null, or when opening side-by-side.

Copilot AI requested review from Copilot and removed request for Copilot May 17, 2026 01:30
Copilot AI linked an issue May 17, 2026 that may be closed by this pull request
…w scenarios

Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 17, 2026 01:37
Copilot AI changed the title [WIP] Fix outline window function selection in child editor Route outline navigation to the source editor's group across windows May 17, 2026
Copilot AI requested a review from dmitrivMS May 17, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selecting a function on outline window does not work correctly

2 participants